package com.youpai.platform.user.web.api;

import com.youpai.platform.common.entity.resp.BaseResponse;
import com.youpai.platform.user.service.service.VersionInfoService;
import com.youpai.platform.user.web.entity.req.VersionInfoReq;
import com.youpai.platform.user.web.entity.resp.VersionInfoResp;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @Description: 版本更新信息相关controller
 * @Author:lizhoujie
 * @Date:2022/11/12
 */
@Slf4j
@RestController
@RequestMapping(value = "/version")
@Api(value = "VersionInfoController", tags = "版本更新信息相关")
public class VersionInfoController {

    @Resource
    private VersionInfoService versionInfoService;

    @ApiOperation(value = "获取版本更新信息")
    @PostMapping(value = "/getVersionInfo")
    public BaseResponse<VersionInfoResp> getVersionInfo(@RequestBody VersionInfoReq req) {
        VersionInfoResp versionInfoResp = versionInfoService.getVersionInfo(req);
        return BaseResponse.success(versionInfoResp);
    }
}
